//LiuZh 2017-06-23
import React, {Component} from 'react';
import {
    StyleSheet,
    Text,
    View,
    Image,
    TouchableWithoutFeedback,
} from 'react-native';

export default class SettingItem extends Component {

    render() {
        const {leftSource, rightSource,onPress, marginTop, info} = this.props;
        return (
            <TouchableWithoutFeedback onPress={onPress}>
                <View style={[styles.body, {marginTop: marginTop,}]}>
                    <Image style={styles.icon} source={leftSource}/>
                    <Text style={styles.infoTxt}>{info}</Text>
                    <View style={{flex: 1,}}/>
                    <Image style={styles.icon} source={rightSource}/>
                </View>
            </TouchableWithoutFeedback>
        );
    }
}

const styles = StyleSheet.create({
    body: {
        padding: 10,
        height: 50,
        flexDirection: 'row',
        justifyContent: 'center',
        alignItems: 'center',
        backgroundColor: '#FFFFFF',
    },
    icon: {
        width: 20,
        height: 20,
        marginRight: 10,
    },
    infoTxt: {
        fontSize: 12,
        color: '#111111',
    }
});